$strMid = Mid ( <string>,
<start index>, [len] )
Extracts a substring
from <string>.
Parameters
<string>
Main string parameter.
<start index>
Start position.
[len] Number
of characters to be extracted.
Return Value
Returns the extracted
substring.
Remarks
- Extracts a substring
of length [len] characters from the string, starting
at position given in the (zero-based index). The
function returns a copy of the extracted substring.
- If length is
not given, the function assumes to extract the string from index till end.
Example
$a = "ABCDEFG"
$b = mid($a,1,2)
$b now contains "BC".
$a = "ABCDEFG"
$b = mid($a,3)
$b now contains "DEFG".
$a = "ABCDEFGH"
$b = mid($a,3)
$b now contains "DEFGH".